'use strict';

/**
 * @ngdoc service
 * @name htmsMobileApp.xiaquService
 * @description
 * # xiaquService
 * 获取辖区信息
 * Service in the htmsMobileApp.
 */
angular.module('htmsMobileApp')
  .service('xiaquService', function ($q,CustomHttp) {
    return {
      getXqByXqid : function (xqid){
        var defered = $q.defer();

        CustomHttp.get("/api/xiaqu/" + xqid).success(
          function(data){
            defered.resolve(data);
          }
        ).error(function(error){
            defered.reject(error);
          });
        return defered.promise;
      },
      getXqsBySjxqid : function (sjxqid){
        var defered = $q.defer();

        CustomHttp.get("/api/xiaqu/sj/" + sjxqid).success(
          function(data){
            defered.resolve(data);
          }
        ).error(function(error){
            defered.reject(error);
          });
        return defered.promise;
      }
    }
  });
